package org.example;

import java.util.*;
import java.io.*;

public class Topology {
    public static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    private static Read in = new Read();
    public static void main(String[] args) throws IOException{
        int n = in.nextInt();
        int m = in.nextInt();
        HashMap<Integer, List<Integer>> hash = new HashMap<>();
        HashMap<Integer, Integer> cnt = new HashMap<>();
        while(m-- > 0){
            int u = in.nextInt();
            int v = in.nextInt();
            //处理出度边
            if(!hash.containsKey(u)){
                hash.put(u, new ArrayList<>());
            }
            hash.get(u).add(v);
            //处理入度边
            cnt.put(v, cnt.getOrDefault(v, 0) + 1);
            if(!cnt.containsKey(u)){
                cnt.put(u, 0);
            }
        }
        //将所有入度为0的点加入到队列中
        Queue<Integer> queue = new LinkedList<>();
        for(Map.Entry<Integer, Integer> e : cnt.entrySet()){
            int key = e.getKey();
            int value = e.getValue();
            if(value == 0){
                queue.add(key);
            }
        }
        List<Integer> ans = new ArrayList<>();
        while(!queue.isEmpty()){
            int tmp = queue.poll();
            ans.add(tmp);
            for(int e : hash.getOrDefault(tmp, new ArrayList<>())){
                cnt.put(e, cnt.get(e) - 1);
                if(cnt.get(e) == 0){
                    queue.add(e);
                }
            }
        }
        if(ans.size() != n){
            System.out.println(-1);
            return;
        }
        for(int  i = 0; i < ans.size() - 1; i++){
            out.print(ans.get(i) + " ");
        }
        out.print(ans.get(ans.size() - 1));
        out.close();
    }
}

class Read{
    //字符串分割类,在读入的时候会遇到'\r' '\n' 需要通过这个类处理
    private StringTokenizer st = new StringTokenizer("");
    //缓冲读入数据
    private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    public String next() throws IOException {
        //处理多行读入，需要使用循环
        while(!st.hasMoreTokens()){
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    public String nextLine() throws IOException {
        return br.readLine();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    long nextLong() throws IOException
    {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException
    {
        return Double.parseDouble(next());
    }
}